package com.example.arithmeticleetcode.learnArithmetic.priority.queue;

/**
 * @program: arithmetic-leetcode
 * @description:
 * @author: FangZhen
 * @create: 2020-11-03 11:49
 **/
public class Main {

    public static void main(String[] args) {

        PriorityQuque<Person> priorityQuque = new PriorityQuque<>();
        priorityQuque.enQuque(new Person("Jack", 2));
        priorityQuque.enQuque(new Person("Rose", 10));
        priorityQuque.enQuque(new Person("Jake", 5));
        priorityQuque.enQuque(new Person("James", 15));


//        while (!priorityQuque.isEmpty()) {
//            System.out.println(priorityQuque.deQuque());
//        }

        int[] arr = {1, 2, 3, 4};
        int i = 0;
        System.out.println(arr[i++]);


    }
}

class Person implements Comparable<Person>{
    private String name;

    private int boneBreak;

    public Person(String name, int boneBreak) {
        this.name = name;
        this.boneBreak = boneBreak;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", boneBreak=" + boneBreak +
                '}';
    }

    @Override
    public int compareTo(Person o) {
//        return this.boneBreak - o.boneBreak;
        return o.boneBreak - this.boneBreak;
    }
}
